<link rel="stylesheet" href="/static/markdown/css/editormd.preview.css" />
<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
    <input type="hidden" name="id" value="{$model.id ?? ''}" required
           placeholder="请输入{$title??'休假'}"
           autocomplete="off"
           class="layui-input" readonly>
    <div class="layui-row">
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
            <div class="layui-form-item">
                <label class="layui-form-label">选择工作流</label>
                <div class="layui-input-block">
                    <select name="flow_id" lay-verify="required" lay-search="">
                        <option value="">直接选择或搜索选择</option>
                        {foreach $flow as $vo}
                        <option value="{$vo.id}" {if condition="($model.type_name eq $vo.flow_name)" }selected{/if}>{$vo.flow_name}</option>
                        {/foreach}

                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md4">
            <div class="layui-form-item">
                <label class="layui-form-label">{$model.type_name ?? $model.approval_type}人</label>
                <div class="layui-input-block">
                    <input type="text" value="{$model.username ?? ''}" required
                           placeholder="请输入{$model.type_name ?? $model.approval_type}'}"
                           autocomplete="off"
                           class="layui-input" readonly>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md4">
            <div class="layui-form-item">
                <label class="layui-form-label">{$model.type_name ?? $model.approval_type}部门</label>
                <div class="layui-input-block">
                    <input type="text" value="{$model.group_name ?? ''}" required
                           placeholder="请输入{$model.group_name ?? $model.approval_type}"
                           autocomplete="off"
                           class="layui-input" readonly>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md4">
            <div class="layui-form-item">
                <label class="layui-form-label">申请日期</label>
                <div class="layui-input-block">
                    <input type="text" value="{$model.res.now_time ?? $model.res.create_time}" name="now_time"
                           lay-verify="required"
                           placeholder="请输入申请日期"
                           autocomplete="off"
                           class="layui-input" readonly>
                </div>
            </div>
        </div>
        {if $model.res.qb eq 1}
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md4">
            <div class="layui-form-item">
                <label class="layui-form-label">{$model.type_name}时间</label>
                <div class="layui-input-block">
                    <input type="text" value="{$model.res.start_time}-{$model.res.end_time}" name="now_time"
                           lay-verify="required"
                           placeholder="请输入申请日期"
                           autocomplete="off"
                           class="layui-input" readonly>
                </div>
            </div>
        </div>
        {/if}
        {if $model.res.qb eq 1 and $model.approval_type eq '调休'}
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
            <div class="layui-form-item">
                <label class="layui-form-label">对应时间</label>
                <div class="layui-input-block">
                    <input type="text" name="corresponding" id="corresponding" value="{$model.res.corresponding ??''}"
                           required
                           placeholder="请输入对应时间"
                           autocomplete="off"
                           class="layui-input" readonly>
                </div>
            </div>
        </div>
        {/if}
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
            <div class="layui-form-item">
                <label class="layui-form-label">{$model.type_name ?? $model.approval_type}事由</label>
                <div class="layui-input-block">
                    <div id="test-editormd-view2">
                        <textarea id="append-test" style="display:none;">{$model.content}</textarea>
                    </div>
<!--                    <textarea placeholder="请输入{$model.type_name ?? $model.approval_type}事由" name="remark" class="layui-textarea">{$model.content ?? ''}</textarea>-->
                </div>
            </div>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-back-submit" id="LAY-user-back-submit" value="确认">
    </div>
</div>
<script src="/static/admin/layui/layui.js"></script>
<script src="/static/markdown/js/jquery.min.js"></script>
<script src="/static/markdown/lib/marked.min.js"></script>
<script src="/static/markdown/lib/prettify.min.js"></script>
<script src="/static/markdown/lib/raphael.min.js"></script>
<script src="/static/markdown/lib/underscore.min.js"></script>
<script src="/static/markdown/lib/sequence-diagram.min.js"></script>
<script src="/static/markdown/lib/flowchart.min.js"></script>
<script src="/static/markdown/lib/jquery.flowchart.min.js"></script>
<script src="/assets/libs/editormd/editormd.min.js"></script>
<script>
    layui.config({
        base: '/static/admin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
        treeTable: '../admin/lib/extend/authtree'
    }).use(['index', 'form', 'laydate', 'colorpicker'], function () {
        var $ = layui.$, form = layui.form, laydate = layui.laydate, colorpicker = layui.colorpicker;

    });
</script>

<script type="text/javascript">
    $(function() {
        var testEditormdView2;
        testEditormdView2 = editormd.markdownToHTML("test-editormd-view2", {
            htmlDecode      : "style,script,iframe",  // you can filter tags decode
            emoji           : true,
            taskList        : true,
            tex             : true,  // 默认不解析
            flowChart       : true,  // 默认不解析
            sequenceDiagram : true,  // 默认不解析
        });
    });
</script>